package com.sdtele.tta.operation;

import java.util.List;

import com.sdtele.tta.dac.Dac;
import com.sdtele.tta.models.JsonRequest;
import com.sdtele.tta.models.JsonResponse;
import com.sdtele.tta.models.User;
import com.sdtele.tta.models.WorkLoad;

public class OperationGetLineChart extends Operation {

	public JsonResponse handle(JsonRequest jsonRequest) {

		JsonResponse jres = new JsonResponse();
		User curUser = (User) request.getSession().getAttribute("user");
		if (curUser != null) {
			List<WorkLoad> lineChartList = Dac.getInstance().getWorkload(curUser.getId());
			jres.setStatus(0);
			jres.setMessage("获取成功");
			jres.setEntity(lineChartList);
		} else {
			jres.setStatus(1);
			jres.setMessage("用户未登录");
		}
		return jres;
	}
}